Apparatus for eliminating moire in scanned image and method for the same

ABSTRACT

A method for eliminating moire in scanned digital image comprises the steps of using an average circuit for taking weighted average and error diffusing a gray level difference between an error diffusion pixel G ij  and neighbor pixels to neighbor to obtain output image pixel Y′ ij ; using a second adder for subtracting the error diffusion pixel G ij  from the output image pixel Y′ ij  to obtain a neighbor image error d ij ; using a error filter H(z) to process the neighbor image error d ij  to obtain a corrected pixel error H(d(i,j)); and using a first adder for adding the corrected pixel error H(d(i,j)) and the input image pixel Y ij  to obtain the corrected error diffusion pixel G ij , and then jumping to first step until all pixels being processed. The method provides real time treatment for eliminating moire and provide smooth image.

FIELD OF THE INVENTION

[0001] The present invention relates to a method for eliminating moire in scanned image, especially to a method for eliminating moire in multiple function printer (MFP) or scanner to obtain better image quality.

BACKGROUND OF THE INVENTION

[0002] The multiple function printer (MFP) and scanner play essential role to produce hot copy image and digital image. To provide image with high fidelity, an image processing software is required to compensate the image obtained through the MFP and scanner.

[0003]FIG. 1 shows a prior art image processing method. The original document is scanned to obtain digitalized RGB data. The digitalized RGB data is subjected to a CMYK conversion, a half-tone treatment and a graphic-text enhancing treatment to obtain CMYK half-tone image. The CMYK half-tone image is printed by a printer module. As can be seen from the flowchart, the scanned image is processed by the CMYK conversion, the half-tone treatment and the graphic-text enhancing treatment to compensate the discrepancy between scanner and printer.

[0004] The half-tone treatment generally adopts order dither and error diffusion methods. The order dither increases gray level by decreasing the resolution of image, i.e., increases the coding point in a region for a specific color to increase the gray level for this color.

[0005] The error diffusion method distributes the error during digitalizing the gray scale image to neighbor pixel. With reference to FIG. 2, the error diffusion method is implemented by a first adder 11, a quantizer circuit 12, a second adder 13 and an error filter 14, wherein X_(ij) is input image pixel, U_(ij) is error diffusion pixel, X′_(ij) is output image pixel, e_(ij) is neighbor image error, H(z) is error filter. The second adder 13 subtracts the error diffusion pixel U_(ij) from the output image pixel X′_(ij) to obtain the neighbor image error e_(ij). The neighbor image error e_(ij) is processed by the error filter H(z) 14 to obtain a corrected pixel error H(e(i,j)). The first adder 11 subtracts the corrected pixel error H(e(i,j)) from the input image pixel X_(ij) to obtain the error diffusion pixel U_(ij). It also means that the pixel error H(e(i,j)) is distributed to the neighbor pixels according to coefficients type of the error filter H(z). The error diffusion pixel U_(ij) is compared with a threshold t in the quantizer circuit 12 to obtain digitalized output (0 or 1). A digital output 1 is obtained when the error diffusion pixel U_(ij) is larger than the threshold t and a digital output 0 is obtained when the error diffusion pixel U_(ij) is smaller than or equal to the threshold t. The error diffusion method distributes quantization error to neighbor pixel to compensate error between one pixel and neighbor pixel.

[0006] The conventional half-tone treatment such as order dither and error diffusion methods generally produces moire in scanned image. Therefore, post treatment such as mask method or frequency domain method such as Fourier transform is used to reduce the moire in scanned image. The about methods become time consuming and complicated when the moire frequently occur or occupies large area.

SUMMARY OF THE INVENTION

[0007] It is an object of the present invention to provide a method for fast eliminating moire in scanned image.

[0008] It is another object of the present invention to provide a method for eliminating moire in scanned image, wherein the weight for error diffusion treatment can be selected according to the complexity of moire.

[0009] It is still another object of the present invention to provide a method for eliminating moire in scanned image, which can perform real time treatment for MPF and scanner.

[0010] To achieve above object, the present invention provides a method for eliminating moire in scanned image, which comprises following steps:

[0011] (a). using an average circuit for taking weighted average and error diffusing a gray level difference between an error diffusion pixel G_(ij) and neighbor pixels to neighbor pixels to obtain output image pixel Y′_(ij);

[0012] (b). using a second adder for operating the output image pixel Y _(ij) and the error diffusion pixel G_(ij) to obtain a neighbor image error d_(ij);

[0013] (c). using an error filter H(z) to process the neighbor image error d_(ij) to obtain a corrected pixel error H(d(i,j)); and

[0014] (d). using a first adder for operating the corrected pixel error H(d(i,j)) and the input image pixel Y_(ij) to obtain the corrected error diffusion pixel G_(ij), and then jumping to step (a) until all pixels being processed.

[0015] To achieve above object, the present invention provides an apparatus for eliminating moire in scanned image, which comprises: a first adder for inputting an image pixel, an average circuit to take weighted average for the image pixel and the neighbor pixels thereof, a second adder to add the output of the first adder and the average circuit to obtain a neighbor image error, and an error filter to distribute the gray level difference of the image pixel to neighbor pixels and then outputs to the first adder; wherein the first adder, operates the output of the error filter and the input image pixel to obtain the corrected image pixel. The average circuit takes average for neighbor corrected image pixel to obtain a corrected output image pixel.

[0016] The various objects and advantages of the present invention will be more readily understood from the following detailed description when read in conjunction with the appended drawing, in which:

BRIEF DESCRIPTION OF DRAWINGS

[0017]FIG. 1 shows a flowchart of prior art treatment for color printing;

[0018]FIG. 2 shows a block diagram of prior art error diffusion treatment;

[0019]FIG. 3 shows a block diagram for implementing the method according to the present invention;

[0020]FIG. 4 shows a flowchart of method for eliminating moire in scanned image according to the present invention; and

[0021]FIG. 5 is a schematic diagram for demonstrating the treatment of the present invention.

DETAILED DESCRIPTION OF THE INVENTION

[0022]FIG. 3 shows a block diagram of a system for implementing the method for eliminating moire in digital image according to the present invention. The system comprises a first adder 21, an average circuit 22, a second adder 23 and an error filter 24, wherein Y_(ij) is input image pixel, G_(ij) is error diffusion pixel, Y″_(ij) is output image pixel, d_(ij) is neighbor image error.

[0023] The average circuit 22 diffuses the gray level difference to neighbor pixels instead of outputting binary value. The average circuit 22 takes weighted average for neighbor pixels to obtain output image pixel Y′_(ij). The second adder 23 subtracts the error diffusion pixel G_(ij) from the output image pixel Y′_(ij) to obtain the neighbor image error d_(ij). The neighbor image error d_(ij) is processed by the error filter H(d) 24 to obtain a corrected pixel error H(e(i,j)).

[0024] The error filter H(d) distributes error to neighbor pixels according to following formula:

H(d)={d×w _(i+p,j+q) |p=−n1,−n1+1, . . . ,n1′−1,n1′ and q=−n2,−n2+1, . . . , n2′−1,n2′},

[0025] wherein n1, n1′, n2, n2′ is natural number, and Σw_(i+p,j+q)=1.

[0026] The first adder 21 subtracts the corrected pixel error H(d(i,j)) from the input image pixel Y_(ij) to obtain the corrected error diffusion pixel G_(ij). The average circuit 22 takes weighted average for the corrected error diffusion pixel G_(ij) and the neighbor pixels to obtain output image pixel Y′_(ij). The average circuit 22 processes each pixel in an image to be processed.

[0027] With reference to FIGS. 4 and 5, the image data in FIG. 5 is segmented to a plurality of lines and processed by the method shown in FIG. 3. The image shown in FIG. 5 is divided into a plurality of lines and the image is subjected to line-based treatment, wherein the image data has width n (represented by variable i) and height m (represented by variable j)

[0028] The process comprises following steps:

[0029] Step 31: processing from a beginning pixel i of a line of image;

[0030] Step 32: the average circuit 22 calculating the weighted average for neighbor pixels to obtain Avg(i,j); ${{Avg}\left( {i,j} \right)} = \frac{{\sum{{{Avg}\left( {i,{j - 1}} \right)} \times {Weight}_{ij}}} + {G\left( {i,j} \right)}}{{\sum{Weight}_{ij}} + 1}$

[0031] Step 33: judging whether Avg(i,j) is larger than white digital count (for 8-bit image, white digital count is 255), if true, going to step 35, else going to step 34;

[0032] Step 34: judging whether Avg(i,j) is less than black digital count (for 8-bit image, black digital count is 0), if true, going to step 36, else going to step 37;

[0033] Step 35: outputting the output image pixel Y′_(ij) with value of white digital count;

[0034] Step 36: outputting the output image pixel Y′_(ij) with value of black digital count;

[0035] Step 37: outputting the output image pixel Y′_(ij) with Avg(i,j);

[0036] Step 38: the second adder 23 subtracting the error diffusion pixel G_(ij) from the output image pixel Y′_(ij) to obtain the neighbor image error d_(ij);

[0037] Step 39: the first adder 21 subtracting the corrected pixel error H(d(i,j)) from the input image pixel Y_(ij) to obtain the corrected error diffusion pixel G_(ij);

[0038] Step 40: judging whether the beginning pixel i reaches the end of the line (i is larger than the image width n); if true, going to step 42, else going to step 41;

[0039] Step 41: adding 1 to i and returning to step 32 for processing next pixel;

[0040] Step 42: obtaining the average for pixels within a line length 2L+1 to get an average value Avg′(i,j) for all pixels along the line, ${{Avg}^{\prime}\left( {i,j} \right)} = \frac{\left\{ {\sum\limits_{K = {- L}}^{L}{Y^{\prime}\left( {{i + k},j} \right)}} \right\}}{\left( {{2L} + 1} \right)}$

[0041] wherein k is an incremental variable, L is the length for taking Gauss smoothing for right and left side pixel(s) of the pixel at position i, the maximal value of L is half of image width. To prevent fuzzy image, L is preferably 1-3.

[0042] then using the Avg(i,j) as reference value for the average circuit 22 for next line and then going to step 43;

[0043] Step 43: judging whether j reaches the bottom line of image (j is larger than the image height m); if true, ending the process, else going to step 44;

[0044] Step 44: adding 1 to j and processing image of next line.

[0045] As can be seen from above description, the method according to the present invention distributes the gray level difference of one pixel to neighbor pixels by a weight distribution according to the coefficients of the type of error filter. When a plurality of lines of image are sent to a buffer during a scanning operation of an MFP or a scanner, a system implemented by the method according to the present invention can process the lines of image stored in the buffer and then save the processed result in the buffer. The process according to the present invention is finished after the scanning operation is ended. The inherent moire in conventional half-tone treatment can be eliminated and smooth image can be obtained.

[0046] To sum up, the method for eliminating moire in scanned digital image according to the present invention has following advantages:

[0047] 1. The weight for error diffusion treatment can be selected according to the complexity of moire. The eliminating effect is more prominent as weight is increased.

[0048] 2. The method according to the present invention can perform real time treatment for MPF and scanner.

[0049] Although the present invention has been described with reference to the preferred embodiment thereof, it will be understood that the invention is not limited to the details thereof. Various substitutions and modifications have suggested in the foregoing description, and other will occur to those of ordinary skill in the art. Therefore, all such substitutions and modifications are intended to be embraced within the scope of the invention as defined in the appended claims. 

I claim:
 1. A method for eliminating moire in scanned digital image, comprising following steps: (a). using an average circuit for taking weighted average and error diffusing a gray level difference between an error diffusion pixel G_(ij) and neighbor pixels to neighbor to obtain output image pixel Y′_(ij); (b). using a second adder for operating the error diffusion pixel G_(ij) and the output image pixel Y′_(ij) to obtain a neighbor image error d_(ij); (c). using a error filter H(z) to process the neighbor image error d_(ij) to obtain a corrected pixel error H(d(i,j)); and (d). using a first adder for operating the corrected pixel error H(d(i,j)) and the input image pixel Y_(ij) to obtain the corrected error diffusion pixel G_(ij), and then jumping to step (a) until all pixels being processed.
 2. The method for eliminating moire in scanned digital image as claim 1, wherein in the step (a), the average circuit chooses different weight according a complexity of the moire to be eliminated.
 3. The method for eliminating moire in scanned digital image as claim 1, wherein in the step (b) the second adder subtracts the error diffusion pixel G_(ij) from the output image pixel Y′_(ij) to obtain a neighbor image error d_(ij).
 4. The method for eliminating moire in scanned digital image as claim 1, wherein in the step (d) the first adder adds the corrected pixel error H(d(i,j)) with the input image pixel Y_(ij) to obtain the corrected error diffusion pixel G_(ij), and then jumping to step (a) until all pixels being processed.
 5. The method for eliminating moire in scanned digital image as claim 1, wherein each image is segmented to a plurality of line images for processing, the average value of one pixel with neighbor pixel in one line being used as reference value of average circuit processing next line.
 6. An apparatus for eliminating moire in scanned digital image, comprising: a. first adder for inputting an image pixel; an average circuit to take weighted average for the image pixel and neighbor pixels thereof; a second adder to add an output of the first adder and the average circuit to obtain a neighbor image error; and an error filter to distribute a gray level difference of the image pixel to neighbor pixels and then output to the first adder; wherein the first adder operates the output of the error filter and the input image pixel to obtain the corrected image pixel, the average circuit takes average for neighbor corrected image pixel to obtain a corrected output image pixel. 